package com.zjw.designPattern.singleton;

/**
 * 静态内部类单例模式(懒加载，线程安全，推荐使用)
 * */
public class SingletonStaticInnerClass {

    private SingletonStaticInnerClass() {
    }

    private static class SingletonInstance{
        private static final SingletonStaticInnerClass INSTANCE = new SingletonStaticInnerClass();
    }

    public static synchronized SingletonStaticInnerClass getInstance(){
        return SingletonInstance.INSTANCE;
    }
}
